-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Editor: Memoize 'getNestedEditedPostProperty' selector helper #54160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Size Change: +14 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in cd8b821. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6076997090
|
jsnajdr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix 👍
|
Thanks for the review, @jsnajdr! |
What?
Memoize the
getNestedEditedPostPropertyselector helper to avoid returning different values when called with the same state and parameters.Why?
While working on #54159, I noticed that
getEditedPostAttribute( 'meta' )would return a different value on each call after making edits to the post meta.When the meta property has been edited, the
getEditedPostAttributewill callgetNestedEditedPostPropertyinternally, where merged values weren't memoized.Testing Instructions
PR includes the unit test.
Prior to #54159.
npm run dev.useSelectwarning will be logged in the console.Screenshots or screencast